<%@ page import="java.sql.* " %> 
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>

<title>Insert title here</title>
</head>
<% //Connection conn = null;%>

<%

try
{
	
//Class.forName("oracle.jdbc.driver.OracleDriver");

//conn = DriverManager.getConnection("jdb:cracle:thin:@localhost:1521:xe","aziendavinicola","filippo");

String dbUrl = "jdbc:oracle:thin:@localhost:1521:xe";
String dbPassword = "filippo";
String dbLogin = "aziendavinicola";
String dbDriver = "oracle.jdbc.OracleDriver";

// carica il driver
Class.forName("oracle.jdbc.driver.OracleDriver");


//Istanzia una connessione
Connection conn;
conn = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","aziendavinicola","filippo");


Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery("SELECT * FROM prova");

//Print start of table and column headers
out.println("<TABLE CELLSPACING=\"0\" CELLPADDING=\"3\" BORDER=\"1\">");
out.println("<TR><TH>ID</TH><TH>NAME</TH></TR>");

//Loop through results of query.
while(rs.next())
{
out.println("<TR>");
out.println("<TD>" + rs.getString(1));
out.println("</TR>");
}

out.println("</TABLE>");
}
catch(SQLException e)
{
out.println("SQLException: " + e.getMessage() + "<BR>");
while((e = e.getNextException()) != null)
out.println(e.getMessage() + "<BR>");
}
catch(ClassNotFoundException e)
{
out.println("ClassNotFoundException: " + e.getMessage() + "<BR>");
}


catch (Exception ignored) {}


%>

</CENTER>
</BODY>
</HTML>